using UniversalAdmin.Application.Common;
using UniversalAdmin.Application.DTOs;
using UniversalAdmin.Domain.Entities;
using UniversalAdmin.Domain.Enums;
using UniversalAdmin.Domain.Interfaces;
using UniversalAdmin.Domain.Repositories;

namespace UniversalAdmin.Application.Services;

public interface IArticleService
{
  Task<PagedResult<ArticleListDto>> GetArticlesAsync(string? keyword, int? categoryId, ArticleStatus? status, int pageIndex, int pageSize);
  Task<ArticleDto?> GetArticleByIdAsync(int id);
  Task<PagedResult<ArticleDto>> SearchArticlesAsync(
        ArticleQueryParameters parameters,
        CancellationToken ct = default);
  Task<ArticleDto> CreateArticleAsync(CreateArticleDto dto, int userId);
  Task<ArticleDto> UpdateArticleAsync(int id, UpdateArticleDto dto, int currentUserId, IEnumerable<string> currentUserRoles);
  Task DeleteArticleAsync(int id, int currentUserId, IEnumerable<string> currentUserRoles);
}